package com.hiv.controller.wechat;

import com.hiv.common.BaseController;
import com.hiv.common.PageInfo;
import com.hiv.common.WebResponse;
import com.hiv.common.param.SendSamplesParam;
import com.hiv.common.param.page.PageQueryBatchParam;
import com.hiv.mapper.domain.Admin;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.hiv.mapper.domain.Batch;
import com.hiv.service.BatchService;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author zhanghong
 * @version XcxBatchController.java, v 0.1 2022-09-27 XcxBatchController Exp $$
 */
@RestController
@RequestMapping("/wechat/batch")
@Api(value = "批次模块", tags = {"【小程序端】批次模块"})
public class XcxBatchController extends BaseController {
    @Autowired
    private BatchService batchService;

    @ApiOperation(value = "寄样", httpMethod = "POST")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "success")})
    @PostMapping("/sendSamples")
    public WebResponse<Boolean> sendSamples(HttpServletRequest request, @RequestBody SendSamplesParam param) {
        Admin admin = validUserLoginAndGet(request, Admin.class);
        return WebResponse.build(batchService.sendSamples(admin, param));
    }
}
